﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Controls_AlbumRotator : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
        Random random = new Random();
        int i = random.Next(1 , System.IO.Directory.GetFiles(MapPath(@"~\Album\")).Count()-4);
        Image1.ImageUrl = "~/Album/" + i + ".jpg";
        Image2.ImageUrl = "~/Album/" + ++i + ".jpg";
        Image3.ImageUrl = "~/Album/" + ++i + ".jpg";
        Image4.ImageUrl = "~/Album/" + ++i + ".jpg";
        Image5.ImageUrl = "~/Album/" + ++i + ".jpg";
    }
}